package org.testfire.translator.watij;

import org.testfire.model.VersionType;
import org.testfire.model.TestsetType;
import org.testfire.translator.TestFireTranslator;

/**
 * Created by IntelliJ IDEA.
 * User: granum
 * Date: Sep 2, 2007
 * Time: 3:52:34 PM
 *
 */
public class VersionToWatijTranslator<T> implements TestFireTranslator<VersionType>
{

    /**
     * Translate the Version xml object to a valid Java comment.
     * @return The version Identifiers comment for the java file.
     */
    public Object translate( TestsetType testset, VersionType version )
    {
        StringBuilder buf = new StringBuilder();
        buf.append( String.format( "/** %3$s Version: %1$d.%2$d */\n", version.getMajor(), version.getMinor(),
            version.getDifferentiator() ) );
        return buf.toString();
    }
}